-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[libc++][ranges] LWG3505: split_view::outer-iterator::operator++ misspecified
#155160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Zingam
merged 7 commits into
llvm:main
from
H-G-Hristov:hgh/libcxx/LWG3505--split_view--outer-iterator--operator++-misspecified
Nov 14, 2025
Merged
[libc++][ranges] LWG3505: split_view::outer-iterator::operator++ misspecified
#155160
Zingam
merged 7 commits into
llvm:main
from
H-G-Hristov:hgh/libcxx/LWG3505--split_view--outer-iterator--operator++-misspecified
Nov 14, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…pecified Implented in LLVM15: llvm@e53c461 Fixes llvm#104320 - https://wg21.link/LWG3505 - https://wg21.link/range.split.outer
Member
|
@llvm/pr-subscribers-libcxx Author: Hristo Hristov (H-G-Hristov) ChangesImplented in LLVM15: e53c461 Fixes #104320 Full diff: https://github.com/llvm/llvm-project/pull/155160.diff 2 Files Affected:
diff --git a/libcxx/docs/Status/Cxx23Issues.csv b/libcxx/docs/Status/Cxx23Issues.csv
index 189f8452e0678..85acbb09f518a 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -58,7 +58,7 @@
"`LWG3495 <https://wg21.link/LWG3495>`__","``constexpr launder`` makes pointers to inactive members of unions usable","2021-02 (Virtual)","|Nothing To Do|","",""
"`LWG3500 <https://wg21.link/LWG3500>`__","``join_view::iterator::operator->()`` is bogus","2021-02 (Virtual)","|Complete|","14",""
"`LWG3502 <https://wg21.link/LWG3502>`__","``elements_view`` should not be allowed to return dangling reference","2021-02 (Virtual)","|Complete|","16",""
-"`LWG3505 <https://wg21.link/LWG3505>`__","``split_view::outer-iterator::operator++`` misspecified","2021-02 (Virtual)","","",""
+"`LWG3505 <https://wg21.link/LWG3505>`__","``split_view::outer-iterator::operator++`` misspecified","2021-02 (Virtual)","|Complete|","15",""
"","","","","",""
"`LWG2774 <https://wg21.link/LWG2774>`__","``std::function`` construction vs assignment","2021-06 (Virtual)","","",""
"`LWG2818 <https://wg21.link/LWG2818>`__","``::std::`` everywhere rule needs tweaking","2021-06 (Virtual)","|Nothing To Do|","",""
diff --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/increment.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/increment.pass.cpp
index 4d765d71407f5..b557346588306 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/increment.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/increment.pass.cpp
@@ -75,6 +75,56 @@ constexpr bool test() {
}
}
+ // LWG3505
+ {
+ using namespace std::string_view_literals;
+
+ { // Motivational example
+ auto v = std::views::lazy_split("xxyx"sv, "xy"sv);
+
+ {
+ auto i = v.begin();
+ assert(std::ranges::equal(*i, "x"s));
+
+ decltype(auto) i2 = ++i;
+ static_assert(std::is_lvalue_reference_v<decltype(i2)>);
+ assert(std::ranges::equal(*i2, "x"s));
+ }
+
+ {
+ auto i = v.begin();
+ assert(std::ranges::equal(*i, "x"s));
+
+ decltype(auto) i2 = i++;
+ static_assert(!std::is_reference_v<decltype(i2)>);
+ assert(std::ranges::equal(*i2, "x"s));
+ assert(std::ranges::equal(*i, "x"s));
+ }
+ }
+ {
+ auto v = std::views::lazy_split("zzht"sv, "zh"sv);
+
+ {
+ auto i = v.begin();
+ assert(std::ranges::equal(*i, "z"s));
+
+ decltype(auto) i2 = ++i;
+ static_assert(std::is_lvalue_reference_v<decltype(i2)>);
+ assert(std::ranges::equal(*i2, "t"s));
+ }
+
+ {
+ auto i = v.begin();
+ assert(std::ranges::equal(*i, "z"s));
+
+ decltype(auto) i2 = i++;
+ static_assert(!std::is_reference_v<decltype(i2)>);
+ assert(std::ranges::equal(*i2, "z"s));
+ assert(std::ranges::equal(*i, "t"s));
+ }
+ }
+ }
+
return true;
}
|
split_view::outer-iterator::operator++ misspecified
…or--operator++-misspecified
…or--operator++-misspecified
…or--operator++-misspecified
…or--operator++-misspecified
…or--operator++-misspecified
frederick-vs-ja
approved these changes
Nov 12, 2025
Contributor
frederick-vs-ja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge this now.
…or--operator++-misspecified
Contributor
|
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented in LLVM15: e53c461
This LWG concerns
lazy_split_viewdespite the outdated title.Closes #104320
References